<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@page import="java.util.Calendar"%>
<%!private String encode(String str)
	{
		String nStr = "";
		try
		{
			nStr = new String(str.getBytes("UTF-8"), "ISO-8859-1");
			//nStr = new String(str.getBytes("ISO-8859-1"), "UTF-8");
		}
		catch (Exception e)
		{
		}
		return nStr;
	}%>

<%
	request.setCharacterEncoding("UTF-8");
	response.setContentType("application/vnd.ms-excel; charset=UTF-8");
	String tableContent = (String) request.getAttribute("tableContent");
	String tmpName = (String) request.getAttribute("fileName");
	//Calendar cal = Calendar.getInstance();
	//String str = cal.get(Calendar.YEAR) + "-" + cal.get(Calendar.MONTH) + "-" + cal.get(Calendar.DATE);
	//str += " " + cal.get(Calendar.HOUR) + ":" + cal.get(Calendar.MINUTE) + ":" + cal.get(Calendar.SECOND);
	//tmpName += "(" + str + ")" + ".xls";
	String fileName = encode(tmpName + ".xls");
	response.setHeader("Content-disposition", "inline; filename=" + fileName);
%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	</head>
	<body>
		<%
			out.print(tableContent);
		%>
	</body>
</html>
